(0, require("../common/component").VantComponent)({
    field: !0,
    classes: [ "icon-class" ],
    props: {
        value: Number,
        isReadOnly: Boolean,
        isDisabled: Boolean,
        allowHalf: Boolean,
        iconSize: {
            type: Number,
            value: 20
        },
        icon: {
            type: String,
            value: "star"
        },
        voidIcon: {
            type: String,
            value: "star-o"
        },
        activeColor: {
            type: String,
            value: "#ffd21e"
        },
        inactiveColor: {
            type: String,
            value: "#c7c7c7"
        },
        disabledColor: {
            type: String,
            value: "#bdbdbd"
        },
        starCount: {
            type: Number,
            value: 5
        }
    },
    data: {
        innerValue: 0
    },
    watch: {
        value: function(newValue) {
            newValue !== this.data.innerValue && this.set({
                innerValue: newValue
            });
        }
    },
    methods: {
        onSelect: function(event) {
            var componentData = this.data, score = event.currentTarget.dataset.score;
            componentData.isDisabled || componentData.isReadOnly || (this.set({
                innerValue: score + 1
            }), this.$emit("input", score + 1), this.$emit("change", score + 1));
        },
        onTouchMove: function(event) {
            var componentInstance = this, touch = event.touches[0], clientX = touch.clientX, clientY = touch.clientY;
            this.getRect(".van-rate__icon", !0).then(function(iconRects) {
                var targetIcon = iconRects.sort(function(icon1, icon2) {
                    return icon1.right - icon1.left;
                }).find(function(icon) {
                    return clientX >= icon.left && clientX <= icon.right && clientY >= icon.top && clientY <= icon.bottom;
                });
                null != targetIcon && componentInstance.onSelect(Object.assign({}, event, {
                    currentTarget: targetIcon
                }));
            });
        }
    }
});